#include <iostream>
#include <Eigen/Dense>

static void do_case_01();
static void do_case_02();
static void do_case_03();

using namespace std;
using namespace Eigen;

int main()
{
    do_case_03();
}

void do_case_01()
{
    MatrixXd m(2, 2);
    m(0, 0) = 3;
    m(1, 0) = 2.5;
    m(0, 1) = -1;
    m(1, 1) = m(1, 0) + m(0, 1);
    std::cout << m << std::endl;
}

void do_case_02()
{
    MatrixXd m = MatrixXd::Random(3, 3);
    m = (m + MatrixXd::Constant(3, 3, 1.2)) * 50;
    std::cout << m << std::endl;

    VectorXd v(3);
    v << 1, 2, 3;
    std::cout << "m * v = " << endl
              << m * v << endl;
}

void do_case_03()
{
    MatrixXd m = MatrixXd::Random(3, 3);
    m = (m + MatrixXd::Constant(3, 3, 1.2)) * 50;
    std::cout << m << std::endl;

    VectorXd v(3);
    v << 1, 2, 3;
    std::cout << "m * v = " << endl
              << m * v << endl;
}